package cn.bocai.pc.dao.imp;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import cn.bocai.pc.dao.BcCollectMapper;
import cn.bocai.pc.model.BcCollect;

@Repository
public class BcCollectMapperImpl extends SqlSessionDaoSupport implements BcCollectMapper {
    String ns="cn.bocai.pc.model.BcCollect.";
	
	 /**
		 * 通过ajax请求将用户即时操作的收藏经常数据库保存
		 * @param BcCollect  对象
		 * @author chenaho
		 * @time 2015/07/07
		 */
	public int insert(BcCollect record) {
		return this.getSqlSession().insert(ns+"insert", record);
	}
	
	
	 /**
	 *先查询改表中是否存在改条信息，如果有就不存入没有就存储
	 * @param id 图片id
	 */
	public BcCollect queryEstimate(Map<String, Object> map) {
		return this.getSqlSession().selectOne(ns+"queryEstimate", map);
	}
	
	 /**
		 *先查询改表中是否存在改条信息，如果有就不存入没有就存储
		 * @param id 图片id
		 */
	public BcCollect queryEstimateNull(Map<String, Object> map) {
			return this.getSqlSession().selectOne(ns+"queryEstimateNull", map);
	}
	
	 /**
	 * 取消收藏
	 * @param par  传递过来的map值
	 * @author chenaho
	 * @time 2015/07/07
	 */ 	
	public int deleteBcCollect(Map<String,String> par) {
		return this.getSqlSession().delete(ns+"deleteBcCollect", par);
	}
	
	/**
	 * 查询出用户收藏的总行数
	 * @param id  传递过来的用户主键id
	 * @author chenaho
	 * @time 2015/07/07
	 */ 
	public int selectAllRow(String id) {
		return this.getSqlSession().selectOne(ns+"selectAllRow", id);
	}
	
	
	/**
	 * 查询出收藏的用户的数据
	 * @param id  传递过来的用户主键id
	 */ 
	public List<BcCollect> seleCollectAll(Map<String,Object> coll) {
		return this.getSqlSession().selectList(ns+"seleCollectAll",coll);
	}
	
	public int deleteByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return 0;
	}

	public BcCollect selectByPrimaryKey(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	public int updateByPrimaryKeySelective(BcCollect record) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int updateByPrimaryKeyWithBLOBs(BcCollect record) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int updateByPrimaryKey(BcCollect record) {
		// TODO Auto-generated method stub
		return 0;
	}



	public int insertSelective(BcCollect record) {
		// TODO Auto-generated method stub
		return 0;
	}


}
